home *** CD-ROM | disk | FTP | other *** search
/ Resource Library: Multimedia / Resource Library: Multimedia.iso / utils / sound / players / unix / xtank / xtank1.3d_ next >
Encoding:
Text File  |  1993-01-31  |  24.0 KB  |  874 lines

  1. #
  2. # This sound patch to xtank1.3d will only work on Suns workstations
  3. # with sound support.
  4. #
  5. # This patch will only work on an original xtank1.3d (as far as I know)
  6. # For sounds to work you must also have the rplay package installed
  7. # on all machines using xtank, this means the server and clients.
  8. # If rplay is not installed on a client machine that client will not
  9. # receive any of the sounds.
  10. # The rplay package along with the sound files are available via anonymous
  11. # ftp at sciences.sdsu.edu.  The Imakefile in the Src directory also
  12. # is setup to link with the librplay.a in /usr/local/lib.  If you changed
  13. # the directory where librplay.a lives you will have to edit the Imakefile
  14. # in Src.
  15. #
  16. # To apply the sound patch...
  17. # % cd your_xtank_directory (the one with Imakefile.Config)
  18. # % patch -p0 < sound-patches >& patchresults
  19. #
  20. # There is a new directory called Sound which contains a file
  21. # called list.  This file contains a list of all the sound file names
  22. # that are to be used for the appropriate xtank sounds.
  23. #
  24. # Send problems/questions/comments to boyns@sciences.sdsu.edu.
  25. #
  26. # Mark
  27. #
  28. *** Src/setup.c    Thu Jun 25 17:07:30 1992
  29. --- xtank1.3d-sound/Src/setup.c    Thu Jun 25 08:40:57 1992
  30. ***************
  31. *** 55,60 ****
  32. --- 55,63 ----
  33.   #include "thread.h"
  34.   #include "globals.h"
  35.   #include "assert.h"
  36. + #ifdef SOUND
  37. + #include "sound.h"
  38. + #endif SOUND
  39.   
  40.   extern Map real_map;
  41.   extern Boolean game_paused;
  42. ***************
  43. *** 279,287 ****
  44. --- 282,298 ----
  45.   
  46.       game_running = True;
  47.   
  48. + #ifdef SOUND
  49. +     play_all(ATTENTION_SOUND);
  50. + #endif SOUND
  51.       do {
  52.           status = animate();
  53.       } while (status == GAME_RUNNING);
  54. + #ifdef SOUND
  55. +     play_all(GOODBYE_SOUND);
  56. + #endif SOUND
  57.   
  58.       game_running = False;
  59.   
  60. *** /dev/null    Wed Jun 24 08:56:45 1992
  61. --- Sounds/list    Tue Jun 23 13:46:07 1992
  62. ***************
  63. *** 0 ****
  64. --- 1,47 ----
  65. + #
  66. + # This file contains the names of the sound files used for sounds.
  67. + # The numbers in the first column represent the number associated
  68. + # with the #defines in Src/Include/Sound.h.
  69. + # When adding new sounds changes must be made both to the Sound.h
  70. + # and this list.  To change a sound just change the name here.
  71. + #
  72. + 0    click1.au        # lmg
  73. + 1    click1.au        # mg 
  74. + 2    click1.au        # hmg 
  75. + 3    click1.au        # lrifle 
  76. + 4    click1.au        # rifle 
  77. + 5    click1.au        # hrifle 
  78. + 6    click1.au        # lcannon 
  79. + 7    click1.au        # cannon 
  80. + 8    click1.au        # hcannon 
  81. + 9    click1.au        # lrocket 
  82. + 10     click1.au        # rocket 
  83. + 11    click1.au        # hrocket 
  84. + 12    click1.au        # acid 
  85. + 13    click1.au        # flame 
  86. + 14    drip.au            # mine 
  87. + 15    Missle1.au        # seeker 
  88. + 16    click1.au        # slick 
  89. + 17    click1.au        # procket 
  90. + 18    click1.au        # umissle 
  91. + 19    click1.au        # harm 
  92. + 20    click1.au        # disc 
  93. + 21    boom.au            # lightcyle explosion
  94. + 22    boom.au            # hexo explosion
  95. + 23    boom.au            # spider explosion
  96. + 24    boom.au            # psycho explosion
  97. + 25    boom.au            # tornado explosion
  98. + 26    boom.au            # marauder explosion
  99. + 27    boom.au            # tiger explosion
  100. + 28    boom.au            # rhino explosion
  101. + 29    boom.au            # medusa explosion
  102. + 30    boom.au            # malice explosion
  103. + 31    boom.au            # trike explosion
  104. + 32    boom.au            # panzy explosion
  105. + 33    bong.au            # vehicle hit wall
  106. + 34    better_boing.au        # vehicle hit vehicle
  107. + 35    arrp.au            # bullet hit vehicle
  108. + 36    tap2.au            # bullet hit wall
  109. + 37    sub_dive_horn.au    # attention
  110. + 38    game_over.au        # goodbye
  111. + 39    Sonar.au        # sonar
  112. *** /dev/null    Tue Jun 23 13:51:37 1992
  113. --- Src/Include/sound.h    Mon Jun 22 16:28:47 1992
  114. ***************
  115. *** 0 ****
  116. --- 1,67 ----
  117. + #ifndef    _sound_h
  118. + #define    _sound_h
  119. + /*
  120. +  * This file contains the sound indexes into the sound table
  121. +  * The indexes here must be consistent with those in the file Sounds/list
  122. +  */
  123. + /*
  124. +  * maximum number of sounds
  125. +  */
  126. + #define MAX_SOUNDS            128
  127. + /*
  128. +  * sounds for all the types of weapons
  129. +  */
  130. + #define LMG_SOUND            0
  131. + #define MG_SOUND            1
  132. + #define HMG_SOUND            2
  133. + #define LRIFLE_SOUND            3
  134. + #define RIFLE_SOUND            4
  135. + #define HRIFLE_SOUND            5
  136. + #define LCANNON_SOUND            6
  137. + #define CANNON_SOUND            7
  138. + #define HCANNON_SOUND            8
  139. + #define LROCKET_SOUND            9
  140. + #define ROCKET_SOUND            10
  141. + #define HROCKET_SOUND            11
  142. + #define ACID_SOUND            12
  143. + #define FLAME_SOUND            13
  144. + #define MINE_SOUND            14
  145. + #define SEEKER_SOUND            15
  146. + #define SLICK_SOUND            16
  147. + #define PROCKET_SOUND            17
  148. + #define UMISSLE_SOUND            18
  149. + #define HARM_SOUND            19
  150. + #define DISC_SOUND            20
  151. + /*
  152. +  * explosion sounds for all tank bodies types
  153. +  */
  154. + #define LIGHTCYCLE_EXPLOSION_SOUND    21
  155. + #define HEXO_EXPLOSION_SOUND        22
  156. + #define SPIDER_EXPLOSION_SOUND        23
  157. + #define PSYCHO_EXPLOSION_SOUND        24
  158. + #define TORNADO_EXPLOSION_SOUND        25
  159. + #define MARAUDER_EXPLOSION_SOUND    26
  160. + #define TIGER_EXPLOSION_SOUND        27
  161. + #define RHINO_EXPLOSION_SOUND        28
  162. + #define MEDUSA_EXPLOSION_SOUND        29
  163. + #define MALICE_EXPLOSION_SOUND        30
  164. + #define TRIKE_EXPLOSION_SOUND        31
  165. + #define PANZY_EXPLOSION_SOUND        32
  166. + /*
  167. +  * hit sounds
  168. +  */
  169. + #define VEHICLE_HIT_WALL_SOUND        33
  170. + #define VEHICLE_HIT_VEHICLE_SOUND    34
  171. + #define BULLET_HIT_VEHICLE_SOUND    35
  172. + #define BULLET_HIT_WALL_SOUND        36
  173. + /*
  174. +  * misc sounds
  175. +  */
  176. + #define ATTENTION_SOUND            37
  177. + #define GOODBYE_SOUND            38
  178. + #define SONAR_SOUND            39
  179. + #endif    _sound_h
  180. *** /dev/null    Tue Jun 23 13:51:37 1992
  181. --- Src/sound.c    Thu Jun 18 14:12:45 1992
  182. ***************
  183. *** 0 ****
  184. --- 1,140 ----
  185. + #include "limits.h"
  186. + #include "xtank.h"
  187. + #include "graphics.h"
  188. + #include "gr.h"
  189. + #include "xtanklib.h"
  190. + #include "vehicle.h"
  191. + #include "globals.h"
  192. + #include "terminal.h"
  193. + #include "assert.h"
  194. + #include <sys/types.h>
  195. + #include <sys/param.h>
  196. + #include <sys/socket.h>
  197. + #include <netinet/in.h>
  198. + #include <netdb.h>
  199. + #include <stdio.h>
  200. + #ifdef SOUND
  201. + #include "sound.h"
  202. + extern Terminal    *terminal[];
  203. + extern int    num_terminals;
  204. + /*
  205. +  * the sound table
  206. +  */
  207. + int    sound_table[MAX_TERMINALS][MAX_SOUNDS];
  208. + /*
  209. +  * initialize sound for the given terminal
  210. +  */
  211. + init_terminal_sound(t)
  212. + Terminal    *t;
  213. + {
  214. +     int        index, id, bind_fd;
  215. +     char        *p, *rindex();
  216. +     char        host[MAXHOSTNAMELEN], buf[MAXPATHLEN], name[MAXPATHLEN];
  217. +     Video        *vidptr;
  218. +     extern char    pathname[], soundsdir[];
  219. +     char        filename[MAXPATHLEN];
  220. +     FILE        *fp;
  221. +     draw_text_rc(ANIM_WIN, 0, 1, "Initializing Sounds...", M_FONT, WHITE);
  222. +     sync_output(TRUE);
  223. +     /*
  224. +      * get the display hostname 
  225. +      */
  226. +     vidptr = (Video *)t->video;
  227. +     sprintf(host, "%s", vidptr->display_name);
  228. +     p = rindex(host, ':');
  229. +     *p = '\0';
  230. +     if (*host == '\0')
  231. +         strcat(host, "localhost");
  232. +     /*
  233. +      * initialize rplayd connection
  234. +      */
  235. +     t->rplay_fd = rplay_init(host);
  236. +     if (t->rplay_fd < 0) {
  237. +         rplay_perror(host);
  238. +         return -1;
  239. +     }
  240. +     /*
  241. +      * initialize rplaybindd connection
  242. +      */
  243. +     bind_fd = rplaybind_init(host);
  244. +     if (bind_fd < 0) {
  245. +         rplay_perror(host);
  246. +         close(t->rplay_fd);
  247. +         t->rplay_fd = -1;
  248. +         return -1;
  249. +     }
  250. +     strcpy(filename, pathname);
  251. +     strcat(filename, "/");
  252. +     strcat(filename, soundsdir);
  253. +     strcat(filename, "/");
  254. +     strcat(filename, "list");
  255. +     fp = fopen(filename, "r");
  256. +     if (fp == NULL) {
  257. +         fprintf(stderr, "Could not open file %s.\n", filename);
  258. +         exit(1);
  259. +     }
  260. +     /*
  261. +      * bind all the sounds in the sounds list to the host
  262. +      * store the returned sound ids in the sound table
  263. +      */
  264. +     while(fgets(buf, sizeof(buf), fp) != NULL) {
  265. +         if (buf[0] == '#' || buf[0] == '\n') continue;
  266. +         sscanf(buf, "%d %s", &index, name);
  267. +         id = rplaybind(bind_fd, name);
  268. +         if (id < 0) {
  269. +             rplay_perror(host);
  270. +             t->rplay_fd = -1;
  271. +             return -1;
  272. +         }
  273. +         if (id == 0) {
  274. +             fprintf(stderr, "%s not found at %s\n", name, host);
  275. +             id = -1;
  276. +         }
  277. +         sound_table[t->num][index] = id;
  278. +     } 
  279. +     /*
  280. +      * close the rplaybindd connection
  281. +      */
  282. +     close(bind_fd);
  283. +     play_terminal(t, SONAR_SOUND);
  284. +     return 0;
  285. + }
  286. + /*
  287. +  * play a sound on a terminal
  288. +  */
  289. + play_terminal(t, index)
  290. + Terminal    *t;
  291. + int        index;
  292. + {
  293. +     if (t->rplay_fd > 0 && sound_table[t->num][index] > 0)
  294. +         rplay(t->rplay_fd, sound_table[t->num][index]);
  295. + }
  296. + /*
  297. +  * play a sound on all terminals
  298. +  */
  299. + play_all(index)
  300. + int    index;
  301. + {
  302. +     int    x;
  303. +     
  304. +     for(x = 0; x < num_terminals; x++)
  305. +         if (terminal[x]->rplay_fd > 0 && sound_table[terminal[x]->num][index] > 0)
  306. +             rplay(terminal[x]->rplay_fd, sound_table[terminal[x]->num][index]);
  307. + }
  308. + #endif SOUND
  309. Common subdirectories: ./Bin and ../xtank1.3d-sound/Bin
  310. Common subdirectories: ./Doc and ../xtank1.3d-sound/Doc
  311. Common subdirectories: ./Help and ../xtank1.3d-sound/Help
  312. diff -c -r ./Imakefile.Config ../xtank1.3d-sound/Imakefile.Config
  313. *** ./Imakefile.Config    Sun Feb  9 21:28:45 1992
  314. --- ../xtank1.3d-sound/Imakefile.Config    Tue Jun 23 09:30:30 1992
  315. ***************
  316. *** 152,162 ****
  317.   /**/# recreate the bug!)
  318.   /**/# Most sites should leave it undefined.
  319.   /**/#
  320.   /**/# Everybody needs to know the following global things about xtank
  321.   
  322.   DEFINES2        = -DX11 -DUNIX -DS1024x864 -DKEYPAD_DETECT \
  323.           -DSTINGY_REDRAW -DBATCH_LINES -DBATCH_POINTS \
  324. !         -DCODE_SIZE=0x20000 -DSTACK_SIZE=0x8000 $(ARCH_DEFINES)
  325.   
  326.   DEFINES         = -DXTANK_DIR=\"/src/pub/xtank\" $(DEFINES2) \
  327.           -DALLDEFINES="\"$(DEFINES2)\""
  328. --- 152,167 ----
  329.   /**/# recreate the bug!)
  330.   /**/# Most sites should leave it undefined.
  331.   /**/#
  332. + /**/# -DSOUND
  333. + /**/# Enable only if you are using a Sun with sound support.
  334. + /**/# You must also have the rplay sound package for sound to work.
  335. + /**/#
  336.   /**/# Everybody needs to know the following global things about xtank
  337.   
  338.   DEFINES2        = -DX11 -DUNIX -DS1024x864 -DKEYPAD_DETECT \
  339.           -DSTINGY_REDRAW -DBATCH_LINES -DBATCH_POINTS \
  340. !         -DCODE_SIZE=0x20000 -DSTACK_SIZE=0x8000 $(ARCH_DEFINES) \
  341. !         -DSOUND
  342.   
  343.   DEFINES         = -DXTANK_DIR=\"/src/pub/xtank\" $(DEFINES2) \
  344.           -DALLDEFINES="\"$(DEFINES2)\""
  345. Common subdirectories: ./Mazes and ../xtank1.3d-sound/Mazes
  346. Common subdirectories: ./Programs and ../xtank1.3d-sound/Programs
  347. Only in ../xtank1.3d-sound: Sounds
  348. Common subdirectories: ./Src and ../xtank1.3d-sound/Src
  349. Common subdirectories: ./Todo and ../xtank1.3d-sound/Todo
  350. Common subdirectories: ./Util and ../xtank1.3d-sound/Util
  351. Common subdirectories: ./Vehicles and ../xtank1.3d-sound/Vehicles
  352. diff -c -r ./Bin/xtank ../xtank1.3d-sound/Bin/xtank
  353. *** ./Bin/xtank    Sat Feb  1 14:00:59 1992
  354. --- ../xtank1.3d-sound/Bin/xtank    Tue Jun 23 09:55:05 1992
  355. ***************
  356. *** 3,8 ****
  357. --- 3,9 ----
  358.   XTANK_VEHICLES=Vehicles
  359.   XTANK_MAZES=Mazes
  360.   XTANK_PROGRAMS=Programs
  361. + XTANK_SOUNDS=Sounds
  362.   
  363.   #
  364.   # rpotter thinks this is a kludge, I think it is funny! (lidl)
  365. Common subdirectories: ./Doc/Src and ../xtank1.3d-sound/Doc/Src
  366. Common subdirectories: ./Programs/Old and ../xtank1.3d-sound/Programs/Old
  367. Common subdirectories: ./Programs/Old/Old and ../xtank1.3d-sound/Programs/Old/Old
  368. Common subdirectories: ./Src/Fixed-Point and ../xtank1.3d-sound/Src/Fixed-Point
  369. diff -c -r ./Src/Imakefile ../xtank1.3d-sound/Src/Imakefile
  370. *** ./Src/Imakefile    Sun Feb  9 21:46:14 1992
  371. --- ../xtank1.3d-sound/Src/Imakefile    Tue Jun 16 10:10:17 1992
  372. ***************
  373. *** 17,23 ****
  374.                       objects.c program.c radar.c repair.c scroll.c setup.c \
  375.                       setups.c status.c sysdep.c thread.c unix.c update.c \
  376.                       util.c vdesign.c vehicle.c newfile.c vload.c \
  377. !                     version.c $(SRCS2)
  378.                OBJS = 3d.o XMultiSync.o actions.o animate.o box.o collision.o \
  379.                       console.o cosell.o display.o escher.o explosion.o \
  380.                       file.o game.o gr.o graphics.o highlib.o hit.o icounter.o \
  381. --- 17,23 ----
  382.                       objects.c program.c radar.c repair.c scroll.c setup.c \
  383.                       setups.c status.c sysdep.c thread.c unix.c update.c \
  384.                       util.c vdesign.c vehicle.c newfile.c vload.c \
  385. !                     sound.c version.c $(SRCS2)
  386.                OBJS = 3d.o XMultiSync.o actions.o animate.o box.o collision.o \
  387.                       console.o cosell.o display.o escher.o explosion.o \
  388.                       file.o game.o gr.o graphics.o highlib.o hit.o icounter.o \
  389. ***************
  390. *** 26,32 ****
  391.                       objects.o program.o radar.o repair.o scroll.o setup.o \
  392.                       setups.o status.o sysdep.o thread.o unix.o update.o \
  393.                       util.o vdesign.o vehicle.o newfile.o vload.o \
  394. !                     version.o $(OBJS2)
  395.                INCL = Include/bullet.h Include/common.h Include/cosell.h \
  396.                       Include/disc.h Include/game.h Include/globals.h \
  397.                       Include/gr.h Include/graphics.h Include/icounter.h \
  398. --- 26,32 ----
  399.                       objects.o program.o radar.o repair.o scroll.o setup.o \
  400.                       setups.o status.o sysdep.o thread.o unix.o update.o \
  401.                       util.o vdesign.o vehicle.o newfile.o vload.o \
  402. !                     sound.o version.o $(OBJS2)
  403.                INCL = Include/bullet.h Include/common.h Include/cosell.h \
  404.                       Include/disc.h Include/game.h Include/globals.h \
  405.                       Include/gr.h Include/graphics.h Include/icounter.h \
  406. ***************
  407. *** 40,46 ****
  408.                       Include/terminal.h Include/thread.h Include/tread-defs.h \
  409.                       Include/types.h Include/vdesc.h Include/vehicle.h \
  410.                       Include/vehicleparts.h Include/vstructs.h \
  411. !                     Include/weapon-defs.h Include/xtank.h Include/xtanklib.h
  412.               XINCL = Include/Xlibos.h Include/x11.h
  413.   
  414.   /**/# Note that both x11.c and mazeconv.c are included in other .c files,
  415. --- 40,47 ----
  416.                       Include/terminal.h Include/thread.h Include/tread-defs.h \
  417.                       Include/types.h Include/vdesc.h Include/vehicle.h \
  418.                       Include/vehicleparts.h Include/vstructs.h \
  419. !                     Include/weapon-defs.h Include/xtank.h Include/xtanklib.h \
  420. !                     Include/sound.h
  421.               XINCL = Include/Xlibos.h Include/x11.h
  422.   
  423.   /**/# Note that both x11.c and mazeconv.c are included in other .c files,
  424. ***************
  425. *** 52,58 ****
  426.   
  427.   /**/# Everybody needs the following libraries
  428.   
  429. !   EXTRA_LIBRARIES = -LPrograms -lxtankrobots -lm
  430.   
  431.   /**/# Start of System Dependent Things
  432.   /**/# (e.g. libraries, linker flags and so forth)
  433. --- 53,59 ----
  434.   
  435.   /**/# Everybody needs the following libraries
  436.   
  437. !   EXTRA_LIBRARIES = -LPrograms -lxtankrobots -lm -L/usr/local/lib -lrplay
  438.   
  439.   /**/# Start of System Dependent Things
  440.   /**/# (e.g. libraries, linker flags and so forth)
  441. ***************
  442. *** 89,95 ****
  443.   #endif
  444.   #ifdef SunArchitecture
  445.       SYS_LIBRARIES = /usr/lib/debug/malloc.o -llwp
  446. !         CCOPTIONS = -Bstatic
  447.   #ifdef SparcArchitecture
  448.   /**/# Sun4
  449.   #else
  450. --- 90,96 ----
  451.   #endif
  452.   #ifdef SunArchitecture
  453.       SYS_LIBRARIES = /usr/lib/debug/malloc.o -llwp
  454. !         CCOPTIONS = /**/#-Bstatic
  455.   #ifdef SparcArchitecture
  456.   /**/# Sun4
  457.   #else
  458. Common subdirectories: ./Src/Include and ../xtank1.3d-sound/Src/Include
  459. Common subdirectories: ./Src/Objects and ../xtank1.3d-sound/Src/Objects
  460. Common subdirectories: ./Src/Old and ../xtank1.3d-sound/Src/Old
  461. Common subdirectories: ./Src/Programs and ../xtank1.3d-sound/Src/Programs
  462. diff -c -r ./Src/file.c ../xtank1.3d-sound/Src/file.c
  463. *** ./Src/file.c    Sun Feb  9 21:45:41 1992
  464. --- ../xtank1.3d-sound/Src/file.c    Wed Jun 17 13:48:56 1992
  465. ***************
  466. *** 120,125 ****
  467. --- 120,128 ----
  468.   char pathname[MAXPATHLEN];
  469.   char headersdir[MAXPATHLEN];    /* full name of directory to find headers in */
  470.   char vehiclesdir[MAXNAMLEN], mazesdir[MAXNAMLEN], programsdir[MAXNAMLEN];
  471. + #ifdef SOUND
  472. + char soundsdir[MAXPATHLEN];
  473. + #endif SOUND
  474.   char username[MAX_STRING], displayname[256];
  475.   
  476.   #ifdef NEED_AUX_FONT
  477. ***************
  478. *** 168,174 ****
  479.       (void) strcpy(filename, "XVDIR:list");
  480.   #endif /* AMIGA */
  481.   
  482. !     draw_text_rc(ANIM_WIN, 0, 1, "Reading vehicle list...", M_FONT, WHITE);
  483.       sync_output(TRUE);
  484.       if ((file = fopen(filename, "r")) != NULL)
  485.       {
  486. --- 171,177 ----
  487.       (void) strcpy(filename, "XVDIR:list");
  488.   #endif /* AMIGA */
  489.   
  490. !     draw_text_rc(ANIM_WIN, 0, 2, "Reading vehicle list...", M_FONT, WHITE);
  491.       sync_output(TRUE);
  492.       if ((file = fopen(filename, "r")) != NULL)
  493.       {
  494. ***************
  495. *** 196,202 ****
  496.       (void) strcpy(filename, "XMDIR:list");
  497.   #endif /* AMIGA */
  498.   
  499. !     draw_text_rc(ANIM_WIN, 0, 2, "Reading maze list...", M_FONT, WHITE);
  500.       sync_output(TRUE);
  501.       if ((file = fopen(filename, "r")) != NULL)
  502.       {
  503. --- 199,205 ----
  504.       (void) strcpy(filename, "XMDIR:list");
  505.   #endif /* AMIGA */
  506.   
  507. !     draw_text_rc(ANIM_WIN, 0, 3, "Reading maze list...", M_FONT, WHITE);
  508.       sync_output(TRUE);
  509.       if ((file = fopen(filename, "r")) != NULL)
  510.       {
  511. ***************
  512. *** 729,734 ****
  513. --- 732,740 ----
  514.       strcpy(vehiclesdir, (p = getenv("XTANK_VEHICLES")) ? p : "Vehicles");
  515.       strcpy(mazesdir, (p = getenv("XTANK_MAZES")) ? p : "Mazes");
  516.       strcpy(programsdir, (p = getenv("XTANK_PROGRAMS")) ? p : "Programs");
  517. + #ifdef SOUND
  518. +     strcpy(soundsdir, (p = getenv("XTANK_SOUNDS")) ? p : "Sounds");
  519. + #endif SOUND
  520.       if ((p = getenv("XTANK_HEADERS")) != NULL) {
  521.           strcpy(headersdir, p);
  522.       } else {
  523. diff -c -r ./Src/gr.c ../xtank1.3d-sound/Src/gr.c
  524. *** ./Src/gr.c    Sun Feb  9 21:45:43 1992
  525. --- ../xtank1.3d-sound/Src/gr.c    Tue Jun 16 11:08:52 1992
  526. ***************
  527. *** 134,139 ****
  528. --- 134,143 ----
  529.       /* Initialize 3D values for terminal */
  530.       init_terminal_3d(t);
  531.   
  532. + #ifdef SOUND
  533. +     init_terminal_sound(t);
  534. + #endif SOUND
  535.       return 0;
  536.   }
  537.   
  538. ***************
  539. *** 174,179 ****
  540. --- 178,188 ----
  541.   close_terminal(t)
  542.   Terminal *t;
  543.   {
  544. + #ifdef SOUND
  545. +     if (t->rplay_fd > 0) {
  546. +         close(t->rplay_fd);
  547. +     }
  548. + #endif SOUND
  549.       close_video((Video *) t->video);
  550.       free((char *) t);
  551.   }
  552. diff -c -r ./Src/hit.c ../xtank1.3d-sound/Src/hit.c
  553. *** ./Src/hit.c    Sun Feb  9 21:45:45 1992
  554. --- ../xtank1.3d-sound/Src/hit.c    Tue Jun 16 10:02:49 1992
  555. ***************
  556. *** 52,59 ****
  557.   #include "terminal.h"
  558.   #include "cosell.h"
  559.   #include "globals.h"
  560.   
  561.   extern Map real_map;
  562.   extern Settings settings;
  563.   
  564. --- 52,61 ----
  565.   #include "terminal.h"
  566.   #include "cosell.h"
  567.   #include "globals.h"
  568. + #ifdef SOUND
  569. + #include "sound.h"
  570. + #endif SOUND
  571.   
  572.   extern Map real_map;
  573.   extern Settings settings;
  574.   
  575. ***************
  576. *** 98,103 ****
  577. --- 100,109 ----
  578.       Side side;
  579.       int has_ramplate1, has_ramplate2;
  580.   
  581. + #ifdef SOUND
  582. +     play_all(VEHICLE_HIT_VEHICLE_SOUND);
  583. + #endif SOUND
  584.   #ifdef GDEBUG
  585.       int itemp1, itemp2;
  586.       static FILE *statfile = NULL;
  587. ***************
  588. *** 196,201 ****
  589. --- 202,211 ----
  590.       int dx, dy, damage, damage1, damage2;
  591.       int has_ramplate = FALSE;
  592.   
  593. + #ifdef SOUND
  594. +     play_all(VEHICLE_HIT_WALL_SOUND); 
  595. + #endif SOUND
  596.   #ifdef GDEBUG
  597.       int itemp1, itemp2;
  598.       static FILE *statfile = NULL;
  599. ***************
  600. *** 335,340 ****
  601. --- 345,354 ----
  602.       FLOAT angle;
  603.       int damage, height;
  604.   
  605. + #ifdef SOUND
  606. +     play_all(BULLET_HIT_VEHICLE_SOUND);
  607. + #endif SOUND
  608.       switch (b->type)
  609.       {
  610.         case DISC:
  611. ***************
  612. *** 469,474 ****
  613. --- 483,492 ----
  614.   {
  615.       FLOAT dx, dy;
  616.       int dam;
  617. + #ifdef SOUND
  618. +     play_all(BULLET_HIT_WALL_SOUND);
  619. + #endif SOUND
  620.   
  621.       /* Compute x and y distances from current location to point of contact */
  622.       switch (dir)
  623. diff -c -r ./Src/lowlib.c ../xtank1.3d-sound/Src/lowlib.c
  624. *** ./Src/lowlib.c    Sun Feb  9 21:45:52 1992
  625. --- ../xtank1.3d-sound/Src/lowlib.c    Tue Jun 16 10:02:49 1992
  626. ***************
  627. *** 73,78 ****
  628. --- 73,81 ----
  629.   #include "cosell.h"
  630.   #include "outpost.h"
  631.   #include "globals.h"
  632. + #ifdef SOUND
  633. + #include "sound.h"
  634. + #endif SOUND
  635.   
  636.   extern Weapon_stat weapon_stat[];
  637.   extern Armor_stat armor_stat[];
  638. ***************
  639. *** 684,689 ****
  640. --- 687,761 ----
  641.   #endif /* !NO_NEW_RADAR */
  642.           make_bullet(cv, &bloc, w->type, angle + PI / 100 * (50 - rnd(101)) / 50);
  643.       }
  644. + #ifdef SOUND
  645. +     switch(w->type) {
  646. +     case LMG:
  647. +         play_all(LMG_SOUND);
  648. +         break;
  649. +     case MG:
  650. +         play_all(MG_SOUND);
  651. +         break;
  652. +     case HMG:
  653. +         play_all(HMG_SOUND);
  654. +         break;
  655. +     case LRIFLE:
  656. +         play_all(LRIFLE_SOUND);
  657. +         break;
  658. +     case RIFLE:
  659. +         play_all(RIFLE_SOUND);
  660. +         break;
  661. +     case HRIFLE:
  662. +         play_all(HRIFLE_SOUND);
  663. +         break;
  664. +     case LCANNON:
  665. +         play_all(LCANNON_SOUND);
  666. +         break;
  667. +     case CANNON:
  668. +         play_all(CANNON_SOUND);
  669. +         break;
  670. +     case HCANNON:
  671. +         play_all(HCANNON_SOUND);
  672. +         break;
  673. +     case LROCKET:
  674. +         play_all(LROCKET_SOUND);
  675. +         break;
  676. +     case ROCKET:
  677. +         play_all(ROCKET_SOUND);
  678. +         break;
  679. +     case HROCKET:
  680. +         play_all(HROCKET_SOUND);
  681. +         break;
  682. +     case ACID:
  683. +         play_all(ACID_SOUND);
  684. +         break;
  685. +     case FLAME:
  686. +         play_all(FLAME_SOUND);
  687. +         break;
  688. +     case MINE:
  689. +         play_all(MINE_SOUND);
  690. +         break;
  691. +     case SEEKER:
  692. +         play_all(SEEKER_SOUND);
  693. +         break;
  694. +     case SLICK:
  695. +         play_all(SLICK_SOUND);
  696. +         break;
  697. +     case PROCKET:
  698. +         play_all(PROCKET_SOUND);
  699. +         break;
  700. +     case UMISSLE:
  701. +         play_all(UMISSLE_SOUND);
  702. +         break;
  703. +     case HARM:
  704. +         play_all(HARM_SOUND);
  705. +         break;
  706. +     case DISC:
  707. +         play_all(DISC_SOUND);
  708. +         break;
  709. +     }
  710. + #endif SOUND
  711.       }
  712.   
  713.       check_time();
  714. diff -c -r ./Src/main.c ../xtank1.3d-sound/Src/main.c
  715. *** ./Src/main.c    Sun Feb  9 21:45:53 1992
  716. --- ../xtank1.3d-sound/Src/main.c    Tue Jun 16 09:48:54 1992
  717. ***************
  718. *** 252,257 ****
  719. --- 252,258 ----
  720.       debug("Opening graphics toolkit");
  721.       open_graphics();
  722.   
  723.       /* Parse command line for display names and make a terminal for each one */
  724.       debug("Making terminals");
  725.       if (argc - iNumOpts > 1)
  726. Only in ../xtank1.3d-sound/Src: sound.c
  727. diff -c -r ./Src/vehicle.c ../xtank1.3d-sound/Src/vehicle.c
  728. *** ./Src/vehicle.c    Sun Feb  9 21:46:11 1992
  729. --- ../xtank1.3d-sound/Src/vehicle.c    Wed Jun 17 13:52:24 1992
  730. ***************
  731. *** 19,24 ****
  732. --- 19,25 ----
  733.    *
  734.   */
  735.   #include "xtank.h"
  736. + #include "graphics.h"
  737.   #include "xtanklib.h"
  738.   #include "vehicle.h"
  739.   #include "globals.h"
  740. ***************
  741. *** 27,34 ****
  742.   #include "disc.h"
  743.   #include "vstructs.h"
  744.   #include "assert.h"
  745.   
  746.   extern int team_color_bright[];
  747.   extern char team_char[];
  748.   extern Map real_map;
  749. --- 28,37 ----
  750.   #include "disc.h"
  751.   #include "vstructs.h"
  752.   #include "assert.h"
  753. + #ifdef SOUND
  754. + #include "sound.h"
  755. + #endif SOUND
  756.   
  757.   extern int team_color_bright[];
  758.   extern char team_char[];
  759.   extern Map real_map;
  760. ***************
  761. *** 380,385 ****
  762. --- 383,446 ----
  763.       int dam;
  764.       int i;
  765.       WeaponType wt;
  766. + /*
  767. +        type     size weight wghtlim space  drag hndl trts cost 
  768. +     {"Lightcycle", 2,   200,   800,   600,  .10,  8,  0,  3000},
  769. +     {"Hexo",       3,  1500,  5000,  4000,  .25,  6,  1,  4000},
  770. +     {"Spider",     3,  2500,  8000,  3000,  .40,  7,  1,  5000},
  771. +     {"Psycho",     4,  5000, 18000,  8000,  .60,  4,  1,  5000},
  772. +     {"Tornado",    4,  7000, 22000, 12000,  .80,  4,  1,  7000},
  773. +     {"Marauder",   5,  9000, 28000, 18000, 1.00,  3,  2, 10000},
  774. +     {"Tiger",      6, 11000, 35000, 22000, 1.50,  5,  1, 12000},
  775. +     {"Rhino",      7, 12000, 40000, 30000, 2.00,  3,  2, 10000},
  776. +     {"Medusa",     7, 14000, 40000, 25000, 1.20,  4,  3, 15000},
  777. +     {"Malice",     5,  4000, 20000, 15000,  .40,  7,  1, 17000},
  778. +     {"Trike",      2,   400,  1600,  1200,  .15,  6,  0,  4000},
  779. +     {"Panzy",      8, 22000, 70000, 45000, 3.00,  3,  4, 25000}
  780. +     The numbers below are taken from indexes into the above table
  781. + */
  782. + #ifdef SOUND
  783. +     switch(body) {
  784. +     case 0:
  785. +         play_all(LIGHTCYCLE_EXPLOSION_SOUND);
  786. +         break;
  787. +     case 1:
  788. +         play_all(HEXO_EXPLOSION_SOUND);
  789. +         break;
  790. +     case 2:
  791. +         play_all(SPIDER_EXPLOSION_SOUND);
  792. +         break;
  793. +     case 3:
  794. +         play_all(PSYCHO_EXPLOSION_SOUND);
  795. +         break;
  796. +     case 4:
  797. +         play_all(TORNADO_EXPLOSION_SOUND);
  798. +         break;
  799. +     case 5:
  800. +         play_all(MARAUDER_EXPLOSION_SOUND);
  801. +         break;
  802. +     case 6:
  803. +         play_all(TIGER_EXPLOSION_SOUND);
  804. +         break;
  805. +     case 7:
  806. +         play_all(RHINO_EXPLOSION_SOUND);
  807. +         break;
  808. +     case 8:
  809. +         play_all(MEDUSA_EXPLOSION_SOUND);
  810. +         break;
  811. +     case 9:
  812. +         play_all(MALICE_EXPLOSION_SOUND);
  813. +         break;
  814. +     case 10:
  815. +         play_all(TRIKE_EXPLOSION_SOUND);
  816. +         break;
  817. +     case 11:
  818. +         play_all(PANZY_EXPLOSION_SOUND);
  819. +         break;
  820. +     }
  821. + #endif SOUND
  822.   
  823.       /* Make a tank explosion around the victim */
  824.       explode_location(victim->loc, 1, EXP_TANK);
  825. Only in ../xtank1.3d-sound/Src/Include: sound.h
  826. diff -c -r ./Src/Include/terminal.h ../xtank1.3d-sound/Src/Include/terminal.h
  827. *** ./Src/Include/terminal.h    Sat Jan 25 21:02:03 1992
  828. --- ../xtank1.3d-sound/Src/Include/terminal.h    Tue Jun 16 10:04:40 1992
  829. ***************
  830. *** 52,57 ****
  831. --- 52,60 ----
  832.       Line  line[MAX_LINES];    /* lines drawn on the screen */
  833.       Boolean observer;        /* True if this terminal is not controlling a
  834.                      vehicle */
  835. + #ifdef SOUND
  836. +     int   rplay_fd;
  837. + #endif SOUND
  838.   } Terminal;
  839.   
  840.